#include <iostream>
#include <algorithm>
using namespace std;
const int N = 55;
int a[N];
bool cmp(int n1, int n2)
{
	return n1 > n2;
}
int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	sort(a, a + n, cmp);
	for (int k = 0; k < 5; k++)
		cout << a[k] << " ";
	return 0;
}